<?php


namespace App\Admin\Controllers;

use App\Http\Controllers\Controller;
use Jxlwqq\DataTable\DataTable;

class table extends Controller
{
    public function tables(){
        // table
        $headers = ['Id', 'Email', 'Name', 'Company'];
        $rows = [
            [1, 'labore21@yahoo.com', 'Ms. Clotilde Gibson', 'Goodwin-Watsica'],
            [2, 'omnis.in@hotmail.com', 'Allie Kuhic', 'Murphy, Koepp and Morar'],
            [3, 'quia65@hotmail.com', 'Prof. Drew Heller', 'Kihn LLC'],
            [4, 'xet@yahoo.com', 'William Koss', 'Becker-Raynor'],
            [5, 'ipsa.aut@gmail.com', 'Ms. Antonietta Kozey Jr.', 'Goooogle'],
        ];

        $style = ['table-bordered','table-hover', 'table-striped'];

        $options = [
            'paging' => true,
            'lengthChange' => false,
            'searching' => false,
            'ordering' => true,
            'info' => true,
            'autoWidth' => false,
        ];

        $dataTable = new DataTable($headers, $rows, $style, $options);

        echo $dataTable->render();
    }
}
